<template>
  <div style="background-color: #fff; padding: 20px ;">
    <div class="ljm-index-title">最新补贴申报记录</div>
    <el-table :data="list" style="width: 100%;padding-top: 15px;">
      <el-table-column label="审核对象">
        <template slot-scope="scope">
          {{ scope.row.name }}
        </template>
      </el-table-column>
      <el-table-column label="申报金额" width="195" align="center">
        <template slot-scope="scope">
          ¥{{ scope.row.money }}
        </template>
      </el-table-column>
      <el-table-column label="类型" width="160" align="center">
        <template slot-scope="{row}">
          {{ row.type }}
        </template>
      </el-table-column>
      <el-table-column label="状态" width="100" align="center">
        <template slot-scope="{row}">
          <el-tag :type="row.status | statusFilter">
            {{ row.status |trafficStatus }}
          </el-tag>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { GetTransaction } from '@/api/user'

export default {
  filters: {
    statusFilter(status) {
      const statusMap = {
        4: 'success',
        2: 'primary',
        3: 'warning',
        6: 'danger',
        5: 'info',
        7: 'success'
      }
      return statusMap[status]
    },
    orderNoFilter(str) {
      return str.substring(0, 30)
    }
  },
  data() {
    return {
      list: []
    }
  },
  created() {
    this.getUserAdmin()
  },
  methods: {
    async getUserAdmin() {
      const formData = await GetTransaction()
      this.list = formData
    }
  }
}
</script>
<style lang="scss" scoped>
  .ljm-index-title{
    color: #333;
    font-weight: bold;
  }
</style>
